﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OneRed.Draw
{
    public class Node : INotifyPropertyChanged
    {
        //节点的ID
        public Guid NodeId { get; set; }

        private double xp;
        public double Xp
        {
            get
            {
                return xp;
            }
            set
            {
                xp = value;
                OnPropertyChanged("Xp");
            }
        }
        private double yp;
        public double Yp
        {
            get
            {
                return yp;
            }
            set
            {
                yp = value;
                OnPropertyChanged("Yp");
            }
        }

        private string text;
        public string Text
        {
            get
            {
                return text;
            }
            set
            {
                text = value;
                OnPropertyChanged("Text");
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
